var reverse = function(x) {
    let zong = 0
    while(x){
        zong = zong*10+x%10
        x = parseInt(zong/10)
        if(zong<Math.pow(-2,31)||zong>Math.pow(2,31)){
            return 0
        }
    }
    return zong
}